"""
while的使用
"""

def testWhile():
    # 和C++非常类似

    num = 1;
    sum = 0;

    while num < 10:
        sum += num
        num += 1
    
    print("1 + 2 + ... + 9 is {}".format(sum))

testWhile()